﻿using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IService
{
    public interface IWhInventoryService
    {
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="data">实体</param>
        /// <returns>结果</returns>
        Task<int> CreateAsync(WhInventory data);

        /// <summary>
        /// 根据ID查询
        /// </summary>
        /// <param name="Id">ID</param>
        /// <returns>用户列表</returns>
        Task<WhInventory> GetByIdAsync(int Id);

        /// <summary>
        /// 查询所有
        /// </summary>
        /// <returns>用户列表</returns>
        Task<List<WhInventory>> GetAllAsync();

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="date">包含更新信息</param>
        Task<int> UpdateAsync(WhInventory date);

        /// <summary>
        /// 根据ID删除
        /// </summary>
        /// <param name="Id">ID</param>
        Task<int> DeleteAsync(int Id);

        Task<List<InventoryAggregateDTO>> GetInventoryAggregateListAsync();

        /// <summary>
        /// 按仓库+库位查询商品（四表联查）
        /// </summary>
        Task<List<WarehouseLocationGoodsDTO>> GetGoodsByWarehouseAndLocationAsync(long warehouseId, long storageLocationId);


        Task<decimal> GetBookInventoryAsync(long warehouseId, long goodsId, long storageLocationId);

        Task<int> AdjustInventoryForStockTakeAsync(long inventoryOrderId);

        Task<WhInventory> GetByCompositeKeyAsync(long warehouseId, long storageLocationId, long goodsId);
    }
}
